<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>登录/注册</title>
		<link rel="stylesheet" href="../css/base.css" />
		<style>
			.login {
				float: left;
			}
			.register{
				float: right;
			}
			h2{
				text-align: center;
			}
			li{
				margin: 10px 0;
			}
			label{
				width: 100px;
				display: inline-block;
			}
			input {
				border: 1px solid #CCCCCC;
				width: 260px;
				padding: 0 5px;
			}
			.button{
				margin: 10px 0;
				background:lightseagreen;
				line-height: 50px;
				text-align: center;
				color: #fff;
				border-radius: 5px ;
			}
			.Msg{
				border: 1px solid #666;
				padding: 15px;
				margin: 20px 0;
			}
			.content{
				box-sizing: border-box;
				min-height: 500px;
				padding: 70px 70px 0;
			}
			input{
				font-size: 14px;
				padding: 3px;
			}
			.code{
				width: 150px;
			}
			.codeBtn{
				display: inline-block;
				width: 100px;
				border: 1px solid #666666;
				margin-left: 10px;
				font-size: 14px;
				padding: 3px 0;
				text-align: center;
			}
			.exit{
				display: none;
			}
		</style>
	</head>
	<body>
		<header>
			<div class="fixedWidth">
				<div class="logo">
					<img src="../img/logo (1).png" alt=""/>
				</div>
				<ul class="headerNav">
					<li><a href="../index.html">首页</a></li>
					<li><a href="vipPrefecture.html">VIP中心</a></li>
					<li><a href="aboutUs.html">关于我们</a></li>
					<li><a href="message.html">信息披露</a></li>
					<li><a href="vipRegister.html">注册VIP会员</a></li>
					<li>
						<span class="loginRegister"><a href="#">登录/注册</a></span>
						<span class="exit"><a href="#">ABC/退出</a></span>						
					</li>
				</ul>
				<div class="clear"></div>
			</div>
		</header>
		<div class="fixedWidth content">
			<div class="login">
				<h2>我是新用户，马上注册享受专业服务</h2>
				<ul class="Msg">
					<li>
						<label for="">公司邮箱：</label><input class="email" type="text" placeholder="公司邮箱" autocomplete/>
					</li>
					<li>
						<label for="">公司名称：</label><input class="company" type="text" placeholder="公司名称" autocomplete/>
					</li>
					<li>
						<label for="">手机号：</label><input class="phone" type="text" placeholder="11位手机号" autocomplete/>
					</li>
					<li>
						<label for="">登录密码：</label><input class="password" type="text" placeholder="6-12位字母+数字组合" autocomplete/>
					</li>
					<li>
						<label for="">短信验证码：</label><input class="code" type="text" placeholder="输入短信验证码" autocomplete/><span class="codeBtn">获取验证码</span>
					</li>
				</ul>
				<a style="color: #FFFFFF;" href="#"><div class="button registerBtn">马上注册</div></a>
				<div class="font12">
					<span style="display: inline-block;width: 10px;height: 10px;border: 1px solid #666;margin-right: 10px;">						
					</span><span>点击即代表同意<a href="">《瑞丰保险用户服务条款》</a></span>
				</div>
			</div>
			<div class="register">
				<h2>我是老用户，直接登录尊享专业服务</h2>
				<ul class="Msg">
					<li>
						<label for="">手机号：</label><input class="phone" name="phone" type="text" placeholder="11位手机号" autocomplete/>
					</li>
					<li>
						<label for="">登录密码：</label><input class="password" name="password" type="text" placeholder="6-12位密码，区分大小写" autocomplete/>
					</li>
					<li style="text-align: right;">
						<a class="font12" href="">忘记密码？点击这里</a>
					</li>
				</ul>
				<a style="color: #FFFFFF;" href="#"><div class="button loginBtn">直接登录</div></a>
			</div>
		</div>
		<footer>
			<div class="fixedWidth">
				<ul class="footerNav">
					<li><a href="contactUs.html">联系我们</a></li>
					<li><a href="disclaimer.html">免责声明</a></li>
					<li><a href="privacyPolicy.html">隐私声明</a></li>
				</ul>
				<div class="copyright">
					<p class="font14">瑞丰保险经纪有限公司版权所有&nbsp;<a href="http://www.miitbeian.gov.cn/">京ICP备18002921号-1</a></p>
					<p class="font14">北京市朝阳区阜通东大街1号院6号楼4层3单元230501</p>
				</div>
			</div>
		</footer>
	</body>
	<script src="../js/url.js"></script>
	<script src="../js/isLogin.js"></script>
	<script>
		var isLogin = window.localStorage.getItem('isLogin');
		var oExit = document.querySelector('.exit'),
			oLoginRegister = document.querySelector('.loginRegister'),
			oLogin = document.querySelector('.loginBtn'),
			oRigister = document.querySelector('.registerBtn');
		if(isLogin=='true'){
			oLoginRegister.style.display='none';
			oExit.style.display='block';
		}else{
			oLoginRegister.style.display='block';
			oExit.style.display='none';
		}
		oExit.addEventListener('click',function(){
			oLoginRegister.style.display='block';
			oExit.style.display='none';
			window.localStorage.setItem('isLogin','false')
		})
//		登陆
		oLogin.addEventListener('click',function(){
			if(phoneVerify(1)&&passwordVerify(1)){
				window.localStorage.setItem('isLogin','true')							
				window.location.href= base_+'/index.html'
			}			
		})
//		注册
		oRigister.addEventListener('click',function(){
			if(emailVerify()&&companyVerify()&&phoneVerify(0)&&passwordVerify(0)){
				window.localStorage.setItem('isLogin','true')
				window.location.href= base_+'/index.html'
			}			
		})
//		//		手机号验证
//		function phoneVerify(){
//			var userMobile = document.querySelector('.phone').value;
//			var pattern=/^1(3|4|5|7|8)\d{9}$/;
//			if(userMobile.length==0){
//				alert('*请填写手机号码');
//				return false;
//			}else if(userMobile.length<11&&userMobile.length>0){
//				alert('*手机号码必须为11位');
//				return false;
//			}else if(!pattern.test(userMobile)){
//				alert('*手机号码格式不正确');		
//				return false;
//			}else{
//				return true;
//			}
//		}
////		密码验证
//		function passwordVerify(){
//			var password = document.querySelector('.password').value;
//			if(password.length==0){
//				alert('请输入登陆密码');
//				return false;
//			}
//			return true;
//		}
	</script>
</html>
